/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tesis.domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author hectdx
 */
@Entity
@Table(name = "historico_parametro_variable")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HistoricoParametroVariable.findAll", query = "SELECT h FROM HistoricoParametroVariable h"),
    @NamedQuery(name = "HistoricoParametroVariable.findByIdhistoricovariable", query = "SELECT h FROM HistoricoParametroVariable h WHERE h.idhistoricovariable = :idhistoricovariable"),
    @NamedQuery(name = "HistoricoParametroVariable.findByFechamodificacion", query = "SELECT h FROM HistoricoParametroVariable h WHERE h.fechamodificacion = :fechamodificacion"),
    @NamedQuery(name = "HistoricoParametroVariable.findByValorvariable", query = "SELECT h FROM HistoricoParametroVariable h WHERE h.valorvariable = :valorvariable")})
public class HistoricoParametroVariable implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "fechamodificacion")
    @Temporal(TemporalType.DATE)
    private Date fechamodificacion;
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idhistoricovariable")
    private Integer idhistoricovariable;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "valorvariable")
    private String valorvariable;
    @JoinColumn(name = "idestacionparametrovariable", referencedColumnName = "idestacionparametrovariable")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private InstanciaEstacionXParemetroVariable idestacionparametrovariable;
    @JoinColumn(name = "idestadoinstancia", referencedColumnName = "idestadoinstancia")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private EstadoInstanciaEstacionXInstanciaEstacion idestadoinstancia;

    public HistoricoParametroVariable() {
    }

    public HistoricoParametroVariable(Integer idhistoricovariable) {
        this.idhistoricovariable = idhistoricovariable;
    }

    public HistoricoParametroVariable(Integer idhistoricovariable, Date fechamodificacion, String valorvariable) {
        this.idhistoricovariable = idhistoricovariable;
        this.fechamodificacion = fechamodificacion;
        this.valorvariable = valorvariable;
    }

    public Integer getIdhistoricovariable() {
        return idhistoricovariable;
    }

    public void setIdhistoricovariable(Integer idhistoricovariable) {
        this.idhistoricovariable = idhistoricovariable;
    }

    public String getValorvariable() {
        return valorvariable;
    }

    public void setValorvariable(String valorvariable) {
        this.valorvariable = valorvariable;
    }

    public InstanciaEstacionXParemetroVariable getIdestacionparametrovariable() {
        return idestacionparametrovariable;
    }

    public void setIdestacionparametrovariable(InstanciaEstacionXParemetroVariable idestacionparametrovariable) {
        this.idestacionparametrovariable = idestacionparametrovariable;
    }

    public EstadoInstanciaEstacionXInstanciaEstacion getIdestadoinstancia() {
        return idestadoinstancia;
    }

    public void setIdestadoinstancia(EstadoInstanciaEstacionXInstanciaEstacion idestadoinstancia) {
        this.idestadoinstancia = idestadoinstancia;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idhistoricovariable != null ? idhistoricovariable.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HistoricoParametroVariable)) {
            return false;
        }
        HistoricoParametroVariable other = (HistoricoParametroVariable) object;
        if ((this.idhistoricovariable == null && other.idhistoricovariable != null) || (this.idhistoricovariable != null && !this.idhistoricovariable.equals(other.idhistoricovariable))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tesis.domain.HistoricoParametroVariable[ idhistoricovariable=" + idhistoricovariable + " ]";
    }

    public Date getFechamodificacion() {
        return fechamodificacion;
    }

    public void setFechamodificacion(Date fechamodificacion) {
        this.fechamodificacion = fechamodificacion;
    }
    
}
